home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 726-750 / 741 / rkrm_lib1 / rkrm_lib1.lha / ASL / filereq.c < prev    next >
C/C++ Source or Header  |  1992-09-03  |  3KB  |  90 lines

  1. ;/* filereq.c - Execute me to compile me with SASC 5.10
  2. LC -b1 -cfistq -v -y -j73 filereq.c
  3. Blink FROM LIB:c.o,filereq.o TO filereq LIBRARY LIB:LC.lib,LIB:Amiga.lib
  4. quit
  5. */
  6.  
  7. /*
  8. Copyright (c) 1992 Commodore-Amiga, Inc.
  9.  
  10. This example is provided in electronic form by Commodore-Amiga, Inc. for
  11. use with the "Amiga ROM Kernel Reference Manual: Libraries", 3rd Edition,
  12. published by Addison-Wesley (ISBN 0-201-56774-1).
  13.  
  14. The "Amiga ROM Kernel Reference Manual: Libraries" contains additional
  15. information on the correct usage of the techniques and operating system
  16. functions presented in these examples.  The source and executable code
  17. of these examples may only be distributed in free electronic form, via
  18. bulletin board or as part of a fully non-commercial and freely
  19. redistributable diskette.  Both the source and executable code (including
  20. comments) must be included, without modification, in any copy.  This
  21. example may not be published in printed form or distributed with any
  22. commercial product.  However, the programming techniques and support
  23. routines set forth in these examples may be used in the development
  24. of original executable software products for Commodore Amiga computers.
  25.  
  26. All other rights reserved.
  27.  
  28. This example is provided "as-is" and is subject to change; no
  29. warranties are made.  All use is at your own risk. No liability or
  30. responsibility is assumed.
  31. */
  32.  
  33. #include <exec/types.h>
  34. #include <exec/libraries.h>
  35. #include <libraries/asl.h>
  36. #include <clib/exec_protos.h>
  37. #include <clib/asl_protos.h>
  38. #include <stdio.h>
  39.  
  40. #ifdef LATTICE
  41. int CXBRK(void)     { return(0); }  /* Disable Lattice CTRL/C handling */
  42. void chkabort(void) { return; }     /* really */
  43. #endif
  44.  
  45. UBYTE *vers = "$VER: filereq 37.0";
  46.  
  47. #define MYLEFTEDGE 0
  48. #define MYTOPEDGE  0
  49. #define MYWIDTH    320
  50. #define MYHEIGHT   400
  51.  
  52. struct Library *AslBase = NULL;
  53.  
  54. struct TagItem frtags[] =
  55. {
  56.     ASL_Hail,       (ULONG)"The RKM file requester",
  57.     ASL_Height,     MYHEIGHT,
  58.     ASL_Width,      MYWIDTH,
  59.     ASL_LeftEdge,   MYLEFTEDGE,
  60.     ASL_TopEdge,    MYTOPEDGE,
  61.     ASL_OKText,     (ULONG)"O KAY",
  62.     ASL_CancelText, (ULONG)"not OK",
  63.     ASL_File,       (ULONG)"asl.library",
  64.     ASL_Dir,        (ULONG)"libs:",
  65.     TAG_DONE
  66. };
  67.  
  68. void main(int argc, char **argv)
  69. {
  70.     struct FileRequester *fr;
  71.  
  72.     if (AslBase = OpenLibrary("asl.library", 37L))
  73.     {
  74.         if (fr = (struct FileRequester *)
  75.             AllocAslRequest(ASL_FileRequest, frtags))
  76.         {
  77.             if (AslRequest(fr, NULL))
  78.             {
  79.                 printf("PATH=%s  FILE=%s\n", fr->rf_Dir, fr->rf_File);
  80.                 printf("To combine the path and filename, copy the path\n");
  81.                 printf("to a buffer, add the filename with Dos AddPart().\n");
  82.             }
  83.             FreeAslRequest(fr);
  84.         }
  85.         else printf("User Cancelled\n");
  86.  
  87.         CloseLibrary(AslBase);
  88.     }
  89. }
  90.